<!--
 * @Author: your name
 * @Date: 2021-05-08 10:06:34
 * @LastEditTime: 2021-06-29 15:55:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \dolphin-data-center-front-end\src\pages\components\projectDetailTabs\tab2.vue
-->

<template>
  <div>
    <a-button type="primary" @click="onAdd">
      <a-icon type="plus" />添加成员
    </a-button>
    <a-list class="member-list" :grid="{ gutter: 16, column: 4 }" :data-source="memberList" style="margin-top: 20px">
      <a-list-item slot="renderItem" slot-scope="item">
        <a-card bordered class="member-card">
          <a-row type="flex" justify="space-between">
            <h3>{{ item.orgUserName }}</h3>
            <a-popconfirm title="你确定要删除该成员吗?" @confirm="confirmDel(item.id,item.postCode)" @cancel="cancelDel">
              <a href="#">删除</a>
            </a-popconfirm>
          </a-row>
          <span>职位：{{
                            item.postCode == 1
                                ? "项目负责人"
                                : item.postCode == 2
                                ? "财务出纳"
                                : item.postCode == 3
                                ? "人事代理"
                                : item.postCode == 4
                                ? "薪税专员"
                                : ""
                        }}</span>
        </a-card>
      </a-list-item>
    </a-list>
  </div>
</template>

<script>
export default {
  name: "tab2",
  props: ["memberList"],
  data () {
    return {
      nowMember: null,
    };
  },
  methods: {
    onAdd () {
      this.$emit("isMeberModal", true);
    },
    confirmDel (id, postCode) {
      this.$emit("delMember", { id, postCode })
    },
    cancelDel () { },
  },
};
</script>

<style lang="less" scoped>
.member-card {
  /deep/ .ant-card-body {
    padding: 16px !important;
    h3 {
      margin-bottom: 0 !important;
    }
  }
}
</style>
